<?php

use yii\helpers\Html;
use yii\grid\GridView;
use yii\widgets\Pjax;
use common\models\Weixin;
/* @var $this yii\web\View */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = Yii::t('app', '微信公众号');
$this->params['breadcrumbs'][] = $this->title;
//print_r($gzh->id);die;
?>
<div class="weixin-index col-md-12">

    <h1><?= Html::encode($this->title) ?></h1>

    <?php if(empty($gzh)){?>
        <p>
            <?= Html::a(Yii::t('app', '新建公众号信息'), ['create'], ['class' => 'btn btn-success']) ?>
        </p>
    <?php }?>

    <?php if(!empty($gzh)){?>
        <p>
            <?= Html::a(Yii::t('app', '修改公众号信息'), ['update', 'id' => $gzh->id], ['class' => 'btn btn-success']) ?>
            <?= Html::a(Yii::t('app', '删除公众号'), ['delete', 'id' => $gzh->id], [
                'class' => 'btn btn-danger',
                'data' => [
                    'confirm' => Yii::t('app', '你确定要删除吗?'),
                    'method' => 'post',
                ],
            ]) ?>
        </p>
    <?php }?>
</div>
<?php
    echo $this->render('/layouts/menu');
?>

<div class="col-md-10">
    <?php Pjax::begin(); ?>
        <?php if(!empty($gzh)){?>
            <div>
                <div>
                    微信验证码：<?= $gzh->code?>
                </div>
                <div>
                    公众号ID：<?= $gzh->gzh_id?>
                </div>
                <div>
                    微信二维码：<?= Html::img('/uploads/gzhimg/'.$gzh->gzh_img,['width'=>'200px;'])?>
                </div>
            </div>
        <?php }?>
    <?php Pjax::end(); ?>
</div>